home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- debox.library/AllocBitMap
- debox.library/BMInfoSize
- debox.library/CenterViewPort
- debox.library/CheckHeader
- debox.library/CreateView
- debox.library/CycleColors
- debox.library/DecompBitMap
- debox.library/DecompBMInfo
- debox.library/DecompData
- debox.library/DeleteView
- debox.library/FreeBitMap
- debox.library/FreeBMInfo
- debox.library/HeaderSize
- debox.library/MemSet
- debox.library/NextComp
- debox.library/AllocBitMap debox.library/AllocBitMap
-
- NAME
- AllocBitMap -- Allocates a BitMap structure and bitplanes.
-
- SYNOPSIS
- bitmap = AllocBitMap (depth, width, height)
- D0 D0 D1 D2
-
- struct BitMap * AllocBitMap (ULONG, ULONG, ULONG);
-
- FUNCTION
- Allocates a bitmap structure and bitplanes (planes are in CHIP
- memory). If any part of it can't be allocated, NULL is returned,
- and nothing will have been allocated. Use FreeBitMap() to
- deallocate the bitmap when finished.
-
- The routine allocates a standard BitMap structure unless the depth.
- is greater than eight. If more than eight bitplanes are requested,
- AllocBitMap() will return a structure with the extra plane pointers at
- the end of the structure.
-
- INPUTS
- depth - in planes.
- width - width in pixels.
- height - in pixels.
-
- RESULT
- bitmap - pointer to BitMap structure, suitably initialized, or NULL
- if there's not enough memory. The bitplanes themselves
- are uninitialized i.e. garbage.
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
- FreeBitMap()
-
- debox.library/BMInfoSize debox.library/BMInfoSize
-
- NAME
- BMInfoSize -- Returns the size of a picture's BMInfo structure.
-
- SYNOPSIS
- size = BMInfoSize (header, data)
- D0 A0 A1
-
- ULONG BMInfoSize (struct CompHeader *, UBYTE *);
-
- FUNCTION
- Returns the bitmap info size for the current picture. You would use
- this if you wished to allocate memory for this data yourself instead
- of having DecompBMInfo() allocate the memory automatically. If
- you were to do so, you may then pass the structure to
- DecompBMInfo() while will fill it in with the picture's data.
-
- The function returns a positive value for success or a negitive
- DEBOXERR value for failure.
-
- INPUTS
- header - pointer to a CompHeader structure or NULL. If NULL then
- the indata parameter is assumed to point to the CompHeader
- structure (all sbox'ed data is in the form <header><data>).
- indata - pointer to the data to be decompressed. If header is not
- NULL then indata should be pointing to the <data> and not
- the <header>.
-
- RESULT
- size - size of BMInfo structure, or negative DEBOXERR value if
- an error occurred.
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
- DecompBMInfo(), cdtv/debox.h
-
- debox.library/CenterViewPort debox.library/CenterViewPort
-
- NAME
- CenterViewPort -- Center a ViewPort on display.
-
- SYNOPSIS
- CenterViewPort (view, viewport)
- A0 A1
-
- void CenterViewPort (struct View *, struct ViewPort *);
-
- FUNCTION
- Centers a ViewPort based on its modes and the View structure passed.
- GfxBase->NormalDisplayColumns and GfxBase->NormalDisplayRows are
- used to get proper screen placement.
-
- This routine is automatically called by CreateView().
-
- INPUTS
- view - pointer to a view structure with the DxOffset and
- DyOffset already set.
- viewport - pointer to an initialized ViewPort structure.
-
- RESULT
-
- EXAMPLE
-
- NOTES
- Normally, if (viewport->DyOffset + view->DyOffset) < 13 then the
- view is not shown. CenterViewPort() makes sure that this
- condition does not occur.
-
- BUGS
- For screens much larger than normal overscan modes, the positioning
- might be off.
-
- SEE ALSO
- CreateView()
-
- debox.library/CheckHeader debox.library/CheckHeader
-
- NAME
- CheckHeader -- Check a debox header structure for validity.
-
- SYNOPSIS
- error = CheckHeader (header)
- A0
-
- BYTE CheckHeader (struct CompHeader *);
-
- FUNCTION
- Checks to see if 'header' is a valid CompHeader structure. The
- function returns a non-zero value if the header is invalid.
-
- INPUTS
- header - pointer to a CompHeader structure.
-
- RESULT
- error - zero (no error) if CompHeader is valid; non-zero otherwise.
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- debox.library/CreateView debox.library/CreateView
-
- NAME
- CreateView -- Creates a complete View out of a bitmap.
-
- SYNOPSIS
- sv = CreateView (sv, bitmap, width, height, modes)
- D0 A0 A1 D0 D1 D2
-
- struct SuperView * CreateView (struct SuperView *, struct BitMap *,
- UWORD, UWORD, UWORD);
-
- FUNCTION
- Properly sets up a SuperView structure so that a LoadView() needs
- only to be called to display the bitmap. The width of the view
- must be greater than 16.
-
- If 'sv' is NULL, the SuperView structure will be allocated by the
- routine. If this is the case the SuperView structure will have the
- SV_ALLOCATED bit set and will be freed when DeleteView() is called.
-
- CreateView() calls CenterViewPort() in order to center the picture
- on the screen. It uses GfxBase->ActiView for its initial
- view->DxOFfset and view->DyOffset values.
-
- INPUTS
- sv - a pointer to a SuperView structure or NULL.
- bitmap - a pointer to properly initialized BitMap structure.
- width - width of the ViewPort.
- height - height of the ViewPort.
- modes - ViewPort modes. The special modes will be passed on to
- the View structure.
-
- RESULT
- sv - pointer to a SuperView structure or NULL if there was
- not enough memory and/or an error occurred. It will also
- return a NULL if 'width' <= 16.
-
- EXAMPLE
-
- NOTES
-
- BUGS
- Creates bogus views when passed very small bitmaps.
-
- SEE ALSO
- DeleteView(), CenterViewPort()
-
- debox.library/CycleColors debox.library/CycleColors
-
- NAME
- CycleColors -- Cycle the colormap according to the BMInfo structure.
-
- SYNOPSIS
- changed = CycleColors (bminfo, microsec)
- D0 A0 D0
-
- BOOL CycleColors (struct BMInfo *, ULONG);
-
- FUNCTION
- Cycle the colors in the BMInfo.bmi_ColorMap according to the
- information contained in bmi_RangeInfo. Portions in bmi_RangeInfo
- are also modified.
-
- Each time CycleColors is called each RangeInfo countdown timer is
- modifed by the microsec value passed in D0. When the RangeInfo
- structure rgi_SecondsLeft and rgi_MicroLeft reach zero the
- bmi_ColorMap is cycled accoring to that RangeInfo's information. If
- the colormap is modified, the function will return a nonzero
- result.
-
- The best way to call this is in a vertical blank interrupt. Pass
- the cycleinfo and microsec equal to 16667 for NTSC or 20000 for PAL.
- If CycleColors() returns nonzero, use LoadRGB4() to load the
- modified palette into the ViewPort.
-
- INPUTS
- bminfo - A properly initilized BMInfo structure.
- microsec - Micro seconds since last call.
-
- RESULT
-
- EXAMPLE
-
- NOTES
- This function does not check to see if the color numbers contained
- in RangeInfo->rgi_CArray are a valid range. It is up to the program
- or faith to check the RangeInfo structure for validity. Also this
- assumes the BMInfo and the RangeInfo structures have been correctly
- set up.
-
- BUGS
-
- SEE ALSO
- graphics.library/LoadRGB4(), cdtv/debox.h
-
- debox.library/DecompBitMap debox.library/DecompBitMap
-
- NAME
- DecompBitMap -- Decompress picture data into a BitMap structure.
-
- SYNOPSIS
- error = DecompBitMap (header, indata, bitmap, mask)
- D0 A0 A1 A2 a3
-
- LONG DecompBitMap (struct CompHeader *, UBYTE *,
- struct BitMap *, PLANEPTR);
-
- FUNCTION
- Decompresses picture data from sbox into a BitMap structure.
- Returns zero if everything happened correctly, or a DEBOXERR_#?
- code.
-
- If the picture has a mask (a flag set in the BMInfo structure),
- the 'mask' parameter must have a pointer to a plane that has the
- same dimensions as the bitmap planes. If there is no mask, this
- field should be left as NULL. DEBOXERR_MISSINGPLANE will be
- returned if a mask is needed.
-
- This routine assumes that the bitmap is the same width, height and
- depth as the decompressed data. If it is not, it will report an
- error, which might happen to be in the form of a GURU.
-
- This can be called without calling DecompBMInfo. However it is the
- caller's responsibility to set up the BitMap correctly.
-
- INPUTS
- header - pointer to a CompHeader structure or NULL. If NULL then
- the indata parameter is assumed to point to the CompHeader
- structure (all sbox'ed data is in the form <header><data>).
- indata - pointer to the start of a picture compressed data area.
- If header is not NULL then indata should be pointing to the
- <data> and not the <header>.
- bitmap - a pointer to a fully initialized BitMap structure that is
- the same size as the picture to be decompressed.
- mask - A PLANEPTR to a mask bitplane of the same dimensions as
- the bitmap's planes. If a mask is not contained in this
- picture, mask should be NULL.
-
- RESULT
- error - zero if everything went well. Non-zero otherwise; check
- debox.h for DEBOXERR_#? codes.
-
- EXAMPLE
-
- NOTES
- Bitplanes need not be in CHIP RAM.
-
- BUGS
-
- SEE ALSO
- cdtv/debox.h
-
- debox.library/DecompBMInfo debox.library/DecompBMInfo
-
- NAME
- DecompBMInfo -- Get info for bitmap compressed data.
-
- SYNOPSIS
- outbminfo = DecompBMInfo (bminfo,header, indata)
- D0 A0 A1 A2
-
- struct BMInfo * DecompBMInfo ( struct BMInfo *,
- struct CompHeader *, UBYTE *);
-
- FUNCTION
- Extracts and allocates a BMInfo structure from a sbox-compressed
- picture file, and returns a pointer to it. If there is any form of
- error (memory shortage, decompression error, et al), NULL will be
- returned.
-
- The resulting BMInfo structure may be used to prepare a bitmap of
- the correct size, then filled in with DecompBitMap().
-
- 'bminfo' can point to a memory block or be NULL. If a NULL is passed
- the function will attemp to allocate the BMInfo structure. This
- allocated structure must be freed using FreeBMInfo(). If 'bminfo'
- point to a block of memory, the block must be at least
- the size of BMInfoSize().
-
- INPUTS
- bminfo - an optional pointer to a BMInfo structure. If a NULL is
- passed then a bitmap structure will be created by this
- function. The size of the BMInfo structure can be found
- by a call to BMInfoSize().
- header - pointer to a CompHeader structure or NULL. If NULL then
- the indata parameter is assumed to point to the CompHeader
- structure (all sbox'ed data is in the form <header><data>).
- indata - pointer to the start of a picture compressed data area.
- If header is not NULL then indata should be pointing to the
- <data> and not the <header>.
-
- RESULT
- outbminfo- pointer to filled-out BMInfo structure, or NULL if there
- was an error. If bminfo was not NULL.
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- debox.library/DecompData debox.library/DecompData
-
- NAME
- DecompData -- Decompresses squeezed box data segments.
-
- SYNOPSIS
- result = DecompData (header, indata, outdata)
- D0 A0 A1 A2
-
- LONG DecompData (struct CompHeader *, UBYTE *, UBYTE *);
-
- FUNCTION
- This is the general decompression function. If ci_Type
- DEBOX_UNKNOWN, you should use this function to decompress
- the data.
-
- It is up to you to "know" what to do with the resulting data.
-
- INPUTS
- header - pointer to a CompHeader structure or NULL. If NULL then
- the indata parameter is assumed to point to the CompHeader
- structure (all sbox'ed data is in the form <header><data>).
- indata - pointer to the data to be decompressed. If header is not
- NULL then indata should be pointing to the <data> and not
- the <header>.
- outdata - pointer to an area of memory to deposit decompressed data.
- The area must be as large as header->hi_Size.
-
- RESULT
- result - Positive for the total number of bytes decompressed
- or a negitive DEBOXERR code.
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- debox.library/DeleteView debox.library/DeleteView
-
- NAME
- DeleteView -- Removes and frees a SuperView structure.
-
- SYNOPSIS
- DeleteView (superview)
- A0
-
- VOID DeleteView (struct SuperView *);
-
- FUNCTION
- Frees everything CreateView() created. If the SV_ALLOCATED bit
- is set in the SuperView structure, DeleteView() will free it, too.
-
- Make sure some other view is loaded before calling this routine.
- Otherwise, you may get a garbage display.
-
- INPUTS
- superview - pointer to a SuperView structure set up or created by
- CreateView().
-
- RESULT
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
- CreateView()
-
- debox.library/FreeBitMap debox.library/FreeBitMap
-
- NAME
- FreeBitMap -- Frees a bitmap created with AllocBitMap().
-
- SYNOPSIS
- FreeBitMap (bitmap)
- A0
-
- void FreeBitMap (struct BitMap *);
-
- FUNCTION
- Frees everything that AllocBitMap() created. The routine will free
- with a depth >8 bitplanes also.
-
- INPUTS
- bitmap - a pointer to a bitmap structure created with
- AllocBitMap().
-
- RESULT
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- debox.library/FreeBMInfo debox.library/FreeBMInfo
-
- NAME
- FreeBMInfo -- Frees the BMInfo structure.
-
- SYNOPSIS
- FreeBMInfo (bminfo)
- A0
-
- void FreeBMInfo (struct BMInfo *);
-
- FUNCTION
- Frees a BMInfo structure created by DecompBMInfo(). This will free
- the entire area of the BMInfo structure, including the included
- color map and range info section.
-
- INPUTS
- bminfo - pointer to a BMInfo structure that was returned from a
- call to DecompBMInfo().
-
- RESULT
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
- DecompBMInfo()
-
- debox.library/HeaderSize debox.library/HeaderSize
-
- NAME
- HeaderSize -- Report the size of the header.
-
- SYNOPSIS
- size = HeaderSize (header)
- D0 A0
-
- ULONG HeaderSize (struct CompHeader *);
-
- FUNCTION
- Returns the size of the header based on the version. Right now it
- will only handle version 1 headers. If a NULL is passed - Version 1
- header size will be returned.
-
- INPUTS
- header - pointer to CompHeader structure
-
- RESULT
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
- HeaderOffset()
-
- debox.library/MemSet debox.library/MemSet
-
- NAME
- MemSet -- General purpose memory-setting routine.
-
- SYNOPSIS
- MemSet (buffer, value, size)
- A0 D0 D1
-
- void MemSet (void *, UBYTE, ULONG);
-
- FUNCTION
- Fills the 'buffer' with the low order byte of 'value' quickly.
-
- INPUTS
- buffer - a pointer to a buffer to be filled.
- value - character to fill the buffer.
- size - size of area to be filled.
-
- RESULT
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
- debox.library/NextComp debox.library/NextComp
-
- NAME
- NextComp -- Go to next decompression data area.
-
- SYNOPSIS
- data = NextComp (header, indata)
- D0 A0 A1
-
- UBYTE * NextComp (struct CompHeader *, UBYTE *);
-
- FUNCTION
- NextComp() returns a pointer the byte just after the current
- decompression block. If, for example, DEBOX files were joined
- together and loaded in as one file, NextComp() could be used to
- get the positions of all the "things" in the file. If an error
- occurs, such as the passed data is invalid, NULL is returned.
-
- INPUTS
- header - pointer to a CompHeader structure or NULL. If NULL then
- the indata parameter is assumed to point to the CompHeader
- structure (all sbox'ed data is in the form <header><data>).
- indata - pointer to the data to be skipped. If header is not NULL
- then indata should be pointing to the <data> and not
- the <header>.
-
- RESULT
- data - pointer to next "thing" in file, or NULL if an error
- occurred.
-
- EXAMPLE
-
- NOTES
-
- BUGS
-
- SEE ALSO
-
-